import axios from "./index";

//=> project list
export function fetchPageProjectApi(currPage, pageSize, keyword) {

    keyword = keyword ? keyword : '';

    var params = {currPage: currPage, pageSize: pageSize, keyword: keyword};
    return axios.get('/proProject/list',{ params: params });
}

//=> get project
export function getProjectApi(projectId) {
    return axios.get('/proProject/projectInfo', { params: {id: projectId}});
}

export function getTemplateData() {
    return axios.get('/proProject/getTemplateData');
}

//=> add project
export function addProjectApi(projectInfo) {
    return axios.post('/proProject/projectInfo', projectInfo);
}

//=> modity project
export function modifyProjectApi(projectInfo) {
    return axios.put('/proProject/projectInfo', projectInfo);
}

// project/fetchProjectFileTree?projectId=1&packageType=Hierarchical&moduleId=0

/// => 生成项目
export function genProjectApi(projectInfo) {
    return axios.post('/proProject/genProject', projectInfo);
}

/// => 生成项目
export function exportGenConfig(projectInfo) {
    return axios.post('/proProject/exportGenConfig', projectInfo);
}





